//
//  TiXianRecordListCell.m
//  NtoccShipper
//
//  Created by zcj on 2021/1/30.
//  Copyright © 2021 zhuchongjin. All rights reserved.
//

#import "TiXianRecordListCell.h"
@interface TiXianRecordListCell()
@property (nonatomic,strong) CJLabel *labTiXianStatus;
@property (nonatomic,strong) CJLabel *labMoney;
@property (nonatomic,strong) UIView *viewRemark;
@property (nonatomic,strong) CJLabel *labRemark;
@property (nonatomic,strong) CJLabel *labTime;

@property (nonatomic,strong) UIView *viewResaon;
@property (nonatomic,strong) CJLabel *labResaonTitle;
@property (nonatomic,strong) CJLabel *labResaon;

@end

@implementation TiXianRecordListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setCellInfoWithModel:(TiXianRecordListModel *)model{
    
    // WAIT_AUDIT：待审核，AUDITED：已审核，REJECT：驳回，DEALING:处理中，SUCCESS：成功,FAIL：失败,、
    self.labTiXianStatus.text = model.status;
    self.viewResaon.hidden = YES;
    if ([model.status isEqual:@"DEALING"]) {
        self.labTiXianStatus.text = @"处理中";
        self.labTiXianStatus.textColor = CJRGB16Color(0x2C7CF6);
        self.labTiXianStatus.backgroundColor = CJRGB16Color(0xE9F2FE);
        
    } else if ([model.status isEqual:@"SUCCESS"]) {
        
        self.labTiXianStatus.text = @"成功";
        self.labTiXianStatus.textColor = CJRGB16Color(0x0AD90F);
        self.labTiXianStatus.backgroundColor = CJRGB16Color(0xE6FBE7);
        
    } else if ([model.status isEqual:@"AUDITED"]) {
        
        self.labTiXianStatus.text = @"已审核";
        self.labTiXianStatus.textColor = CJRGB16Color(0x0AD90F);
        self.labTiXianStatus.backgroundColor = CJRGB16Color(0xE6FBE7);
        
    } else if ([model.status isEqual:@"WAIT_AUDIT"]) {
        
        self.labTiXianStatus.text = @"待审核";
        self.labTiXianStatus.textColor =CJRGB16Color(0xFF801D);
        self.labTiXianStatus.backgroundColor =CJRGB16Color(0xFFF2E8);
        
    } else if ([model.status isEqual:@"FAIL"]) {
        
        self.labTiXianStatus.text = @"失败";
        self.labTiXianStatus.textColor = CJRGB16Color(0xFF3D1D);
        self.labTiXianStatus.backgroundColor = CJRGB16Color(0xFFEBE8);
        self.viewResaon.hidden = NO;
        self.labResaonTitle.text = @"失败原因:";

    } else if ([model.status isEqual:@"REJECT"]) {
        
        self.labTiXianStatus.text = @"驳回";
        self.labTiXianStatus.textColor = CJRGB16Color(0xFF3D1D);
        self.labTiXianStatus.backgroundColor = CJRGB16Color(0xFFEBE8);
        self.viewResaon.hidden = NO;
        self.labResaonTitle.text = @"驳回原因:";

    }
    
    self.labMoney.text = @(model.totalAmount).cj_money_description;
    self.labRemark.text = [CJRegular getIsStrEmpty:model.memo] ? @"":model.memo;
    self.viewRemark.hidden = [CJRegular getIsStrEmpty:model.memo] ? YES:NO;
    self.labTime.text = model.gmtCreated;
    self.labResaon.text = [CJRegular getIsStrEmpty:model.errorDesc] ? @"":model.errorDesc;
    self.viewResaon.hidden = [CJRegular getIsStrEmpty:model.errorDesc] ? YES:NO;
    
}


@end
